<template>
  <div id="app" ref="app" :style="{height:page_height+'px'}">
      <transition :name="transition">
          <keep-alive :include="keep">
            <router-view/>
          </keep-alive>
      </transition>
  </div>
</template>

<script>
import store from './store.js';
import common from './public/common.js';
export default {
  data(){
    return {
      page_height:store.state.height,  //app页面高度
      uid:sysinfo.uid,  //用户id
      transition:'animated fadeOutLeft faster delay-2s',
      keep:['activity']
    }
  },
  created(){
    //获取门店信息
    common.store()
            .then((res)=>{
              if(!res){
                this.$router.push('/edit/add');
              }
            })
            .catch((error)=>{
              console.log(error);
            });
  },
  watch:{
    "$route"(to,from){
      if(to.meta.sort > from.meta.sort){
        this.transition = 'animated fadeOutLeft fast delay-2s';
      }else if(to.meta.sort < from.meta.sort){
        this.transition = 'animated fadeOutRight fast delay-2s';
      }else{
        this.transition = '';
      }
    }
  }
}
</script>

<style>
body{
  -webkit-overflow-scrolling: touch;
}
#app {
  position: relative;
  overflow: hidden;
  -webkit-overflow-scrolling : touch;
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color:#000;
  font-size:19px;
}
.childred-page{
    position: fixed;
    background: #fff;
    z-index:99;
    top:0;
    width: 375px;
}
    .cube-pullup-wrapper{
        font-size:16px;
        color:#666;
    }
</style>
